﻿<Window x:Class="PowerSong.UserInterface.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="PowerSong" Height="600" Width="950" Icon="/PowerSong;component/Icons/BlackIcon.ico"
        WindowStartupLocation="CenterScreen" xmlns:my="clr-namespace:PowerSong.UserInterface"
        MinHeight="531" MinWidth="877" Closing="Window_Closing">
    <Window.Resources>
        <RoutedUICommand x:Key="ShowNothingCommand" Text="Show Nothing" />
        <RoutedUICommand x:Key="ShowBackgroundCommand" Text="Show Background" />
        <RoutedUICommand x:Key="ShowEverythingCommand" Text="Show Everything" />
        <RoutedUICommand x:Key="AdvanceToNextVerseCommand" Text="Advance to Next Verse" />
        <RoutedUICommand x:Key="ProjectSongNowCommand" Text="Project Song Now" />
        <RoutedUICommand x:Key="CreateProjectorWindowCommand" Text="Create Projector Window" />
    </Window.Resources>
    <Window.CommandBindings>
        <CommandBinding Command="{StaticResource ShowNothingCommand}" Executed="ShowNothingCommandExecute" />
        <CommandBinding Command="{StaticResource ShowBackgroundCommand}" Executed="ShowBackgroundCommandExecute" />
        <CommandBinding Command="{StaticResource ShowEverythingCommand}" Executed="ShowEverythingCommandExecute" />
        <CommandBinding Command="{StaticResource AdvanceToNextVerseCommand}" Executed="AdvanceToNextVerseCommandExecute" />
        <CommandBinding Command="{StaticResource ProjectSongNowCommand}" Executed="ProjectSongNowCommandExecute" />
        <CommandBinding Command="{StaticResource CreateProjectorWindowCommand}" Executed="CreateProjectorWindowCommandExecute" />
    </Window.CommandBindings>
    <Window.InputBindings>
        <KeyBinding Key="F10" Command="{StaticResource ShowNothingCommand}" />
        <KeyBinding Key="F11" Command="{StaticResource ShowBackgroundCommand}" />
        <KeyBinding Key="F12" Command="{StaticResource ShowEverythingCommand}" />
        <KeyBinding Key="Return" Command="{StaticResource AdvanceToNextVerseCommand}" />
        <KeyBinding Modifiers="Control" Key="P" Command="{StaticResource ProjectSongNowCommand}" />
        <KeyBinding Key="F4" Command="{StaticResource CreateProjectorWindowCommand}" />
    </Window.InputBindings>
    <Grid>
        <Menu Height="23" VerticalAlignment="Top">
            <MenuItem Header="_Database">
                <MenuItem Name="CreateDatabaseMenuItem" Header="_Create Database..." Click="CreateDatabaseMenuItem_Click" />
                <MenuItem Name="LoadDatabaseMenuItem" Header="_Load Database..." Click="LoadDatabaseMenuItem_Click" />
                <Separator />
                <MenuItem Name="ExportDataMenuItem" Header="_Export Data..." Click="ExportDataMenuItem_Click" />
                <MenuItem Name="ImportDataMenuItem" Header="_Import Data..." Click="ImportDataMenuItem_Click" />
                <Separator />
                <MenuItem Name="ExitMenuItem" Header="E_xit PowerSong" Click="ExitMenuItem_Click" />
            </MenuItem>
            <MenuItem Header="_Projection">
                <MenuItem Header="Projection Target">
                    <MenuItem Header="Remove all live projectors" />
                    <MenuItem Header="Show projection only on monitor 0" />
                    <MenuItem Header="Show projection only on monitor 1" />
                    <MenuItem Header="Show projection on all other monitors" />
                </MenuItem>
                <Separator />
                <MenuItem InputGestureText="F4" Command="{StaticResource CreateProjectorWindowCommand}" Header="_Create Window" />
                <Separator />
                <MenuItem Command="{StaticResource ShowNothingCommand}" Name="ShowNothingMenuItem" Header="Show Nothing" InputGestureText="F10" />
                <MenuItem Command="{StaticResource ShowBackgroundCommand}" Name="ShowBackgroundMenuItem" Header="Show Background" InputGestureText="F11" />
                <MenuItem Command="{StaticResource ShowEverythingCommand}" Name="ShowEverythingMenuItem" Header="Show Everything" InputGestureText="F12" />
            </MenuItem>
            <MenuItem Header="Play _List">
                <MenuItem Name="AddSongToPlayListMenuItem" Header="Add _Song..." Click="AddSongToPlayListMenuItem_Click" />
                <MenuItem Name="AddBibleChapterToPlayListMenuItem" Header="Add _Bible Chapter..." Click="AddBibleChapterToPlayListMenuItem_Click" />
                <MenuItem Name="AddNoticeToPlayListMenuItem" Header="Add _Full Screen Notice..." Click="AddNoticeToPlayListMenuItem_Click" />
                <MenuItem Name="AddBannerToPlayListMenuItem" Header="Add _Scrolling Notice..." Click="AddBannerToPlayListMenuItem_Click" />
                <MenuItem Name="AddVideoToPlayListMenuItem" Header="Add _Video..." Click="AddVideoToPlayListMenuItem_Click" />
                <Separator />
                <MenuItem Name="LoadPlayListMenuItem" Header="_Load Play List..." Click="LoadPlayListMenuItem_Click" />
                <MenuItem Name="SavePlayListMenuItem" Header="_Save Play List..." Click="SavePlayListMenuItem_Click" />
                <Separator />
                <MenuItem Name="ClearPlayListMenuItem" Header="_Clear Play List" Click="ClearPlayListMenuItem_Click" />
            </MenuItem>
            <MenuItem Header="_Tools">
                <MenuItem Name="ConfigureStylesMenuItem" Header="Configure _Styles..." Click="ConfigureStylesMenuItem_Click" />
                <MenuItem Name="ConfigureCategoriesMenuItem" Header="Configure Song _Categories..." Click="ConfigureCategoriesMenuItem_Click" />
                <MenuItem Name="ConfigureLicensesMenuItem" Header="Configure _Licenses..." Click="ConfigureLicensesMenuItem_Click" />
                <MenuItem Name="ConfigurePowerSongMenuItem" Header="Configure _PowerSong..." Click="ConfigurePowerSongMenuItem_Click" />
                <Separator />
                <MenuItem Name="ReportingMenuItem" Header="_Reporting..." Click="ReportingMenuItem_Click" />
            </MenuItem>
            <MenuItem Header="_Help">
                <MenuItem Name="SendFeedbackMenuItem" Header="_Send Feedback..." Click="SendFeedbackMenuItem_Click" />
                <Separator />
                <MenuItem Name="AboutPowerSongMenuItem" Header="_About PowerSong..." Click="AboutPowerSongMenuItem_Click" />
            </MenuItem>
        </Menu>
        <Border Height="221" Margin="270,0,0,12" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="296" BorderBrush="#A4000000" BorderThickness="1" CornerRadius="8" Padding="3" Background="Black">
            <Grid Name="PreviewProjectorGrid">
                <Grid.ContextMenu>
                    <ContextMenu>
                        <MenuItem InputGestureText="F4" Header="Create Projection _Window" Command="{StaticResource CreateProjectorWindowCommand}" />
                        <MenuItem Header="Change Projection _Target..." />
                    </ContextMenu>
                </Grid.ContextMenu>
            </Grid>
        </Border>
        <ListBox Margin="270,57,0,267" Name="ServiceListBox" MouseDoubleClick="ServiceListBox_MouseDoubleClick" SelectionChanged="ServiceListBox_SelectionChanged" SelectionMode="Extended" HorizontalAlignment="Left" Width="318" HorizontalContentAlignment="Stretch">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Background="{Binding Background}">
                        <Border Margin="0,8,8,8" CornerRadius="6" Width="40" Height="40" BorderThickness="1" BorderBrush="Silver" VerticalAlignment="Center" Background="{Binding TileBackground}" />
                        <StackPanel Margin="0,4,0,4" Orientation="Vertical" VerticalAlignment="Center">
                            <TextBlock Text="{Binding Title}" Foreground="{Binding Foreground}" TextWrapping="Wrap" FontWeight="Bold" />
                            <TextBlock Text="{Binding Subtitle}" Foreground="{Binding Foreground}" TextWrapping="Wrap" />
                        </StackPanel>                        
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
            <ListBox.ContextMenu>
                <ContextMenu>
                    <MenuItem Name="ChangeServiceItemOptionsMenuItem" Header="_Edit..." Click="ChangeServiceItemOptionsButton_Click" />
                    <MenuItem Name="ChangeServiceItemStyleMenuItem" Header="Change _Style..." Click="ChangeServiceItemStyleButton_Click" />
                    <MenuItem Name="ProjectServiceItemNowMenuItem" Header="_Project Now" Click="ActivateSongButton_Click" />
                    <MenuItem Name="RemoveServiceItemFromPlayListMenuItem" Header="_Remove" Click="RemoveFromPlayListButton_Click" />
                    <Separator />
                    <MenuItem Header="Add _Song..." Click="AddSongToPlayListMenuItem_Click" />
                    <MenuItem Header="Add _Bible Chapter..." Click="AddBibleChapterToPlayListMenuItem_Click" />
                    <MenuItem Header="Add _Full Screen Notice..." Click="AddNoticeToPlayListMenuItem_Click" />
                    <MenuItem Header="Add _Scrolling Notice..." Click="AddBannerToPlayListMenuItem_Click" />
                    <MenuItem Header="Add _Video..." Click="AddVideoToPlayListMenuItem_Click" />
                    <Separator />
                    <MenuItem Header="_Load Play List..." Click="LoadPlayListMenuItem_Click" />
                    <MenuItem Header="_Save Play List..." Click="SavePlayListMenuItem_Click" />
                </ContextMenu>
            </ListBox.ContextMenu>
        </ListBox>
        <my:WrapButton Command="{StaticResource ShowNothingCommand}" ButtonText="Show Nothing (F10)" Height="44" HorizontalAlignment="Left" Margin="572,0,0,189" VerticalAlignment="Bottom" Width="106" x:Name="ShowNothingButton" />
        <my:WrapButton Command="{StaticResource ShowBackgroundCommand}" ButtonText="Show Background (F11)" Height="44" HorizontalAlignment="Left" Margin="572,0,0,139" VerticalAlignment="Bottom" Width="106" x:Name="ShowBackgroundButton" />
        <my:WrapButton Command="{StaticResource ShowEverythingCommand}" ButtonText="Show Everything (F12)" Height="44" HorizontalAlignment="Left" Margin="572,0,0,89" VerticalAlignment="Bottom" Width="105" x:Name="ShowEverythingButton" />
        <my:Title HorizontalAlignment="Left" Margin="12,29,0,0" VerticalAlignment="Top" Header="Song Database" Width="252" HeaderBackground="#230000D6" />
        <my:Title Margin="270,29,0,0" x:Name="title2" VerticalAlignment="Top" Header="Play List" HeaderBackground="#2300B900" HorizontalAlignment="Left" Width="408" />
        <my:Title Margin="270,0,0,239" x:Name="title4" VerticalAlignment="Bottom" Header="Projection" HeaderBackground="#23DCE600" HorizontalAlignment="Left" Width="408" />
        <Button Content="Move Down" Height="23" HorizontalAlignment="Left" Margin="594,0,0,296" Name="MoveDownButton" VerticalAlignment="Bottom" Width="84" Click="MoveDownButton_Click" />
        <Button Content="Move Up" Height="23" HorizontalAlignment="Left" Margin="594,0,0,325" Name="MoveUpButton" VerticalAlignment="Bottom" Width="84" Click="MoveUpButton_Click" />
        <Button Content="_Show »" Height="23" HorizontalAlignment="Left" Margin="594,57,0,0" Name="ActivateSongButton" VerticalAlignment="Top" Width="84" Click="ActivateSongButton_Click" />
        <Button Content="Remove" Height="23" HorizontalAlignment="Left" Margin="594,0,0,267" Name="RemoveFromPlayListButton" VerticalAlignment="Bottom" Width="84" Click="RemoveFromPlayListButton_Click" />
        <Button Content="_Edit..." HorizontalAlignment="Left" Margin="594,86,0,0" Name="ChangeServiceItemOptionsButton" Width="84" Click="ChangeServiceItemOptionsButton_Click" Height="23" VerticalAlignment="Top" />
        <Button Content="Change _Style..." Height="23" HorizontalAlignment="Left" Margin="594,115,0,0" Name="ChangeServiceItemStyleButton" VerticalAlignment="Top" Width="84" Click="ChangeServiceItemStyleButton_Click" />
        <Grid Margin="685,30,12,12" Name="VideoGrid" Visibility="Hidden">
            <my:VideoPlaybackPanel Margin="0,29,0,0" x:Name="VideoPanel" />
            <my:Title Header="Video Playback" HeaderBackground="#23D80000" VerticalAlignment="Top" />
        </Grid>
        <Grid Margin="685,29,12,12" Name="VersesGrid">
            <my:Title Header="Verses" HeaderBackground="#23D80000" VerticalAlignment="Top" />
            <my:VerseListBox Margin="0,29" x:Name="VersesListBox" ActiveVerseChanged="VersesListBox_ActiveVerseChanged">
                <my:VerseListBox.ContextMenu>
                    <ContextMenu>
                        <MenuItem Header="_Project Selected Verse" Name="ProjectSelectedVerseMenuItem" />
                        <Separator />
                        <MenuItem Header="Edit _Song..." Name="EditSongFromVerseListMenuItem" />
                        <Separator />
                        <MenuItem Click="AddVerseMenuItem_Click" Header="_Add Verse..." Name="AddVerseMenuItem" />
                        <MenuItem Click="EditVerseMenuItem_Click" Header="_Edit Verse..." Name="EditVerseMenuItem" />
                        <MenuItem Click="DeleteVerseMenuItem_Click" Header="_Delete Verse" Name="DeleteVerseMenuItem" />
                    </ContextMenu>
                </my:VerseListBox.ContextMenu>
            </my:VerseListBox>
            <Button Content="Edit Song" Height="23" HorizontalAlignment="Right" Name="EditSongButton" VerticalAlignment="Bottom" Width="61" Click="EditSongButton_Click" />
            <Button Command="{StaticResource AdvanceToNextVerseCommand}" Content="Next" Height="23" HorizontalAlignment="Left" Margin="58,0,0,0" Name="NextButton" VerticalAlignment="Bottom" Width="37" />
            <Button Content="Previous" Height="23" HorizontalAlignment="Left" Name="PreviousButton" VerticalAlignment="Bottom" Width="52" Click="PreviousButton_Click" />
        </Grid>
        <Grid HorizontalAlignment="Left" Margin="12,57,0,12" Name="grid2" Width="252">
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Border Grid.Row="0" CornerRadius="4" BorderBrush="#230000D6" BorderThickness="2" Background="#0E0000FF">
                <Grid>
                    <RadioButton Content="Bible" HorizontalAlignment="Right" Margin="0,6,6,0" Name="BibleRadioButton" VerticalAlignment="Top" Checked="BibleRadioButton_Checked" />
                    <RadioButton Content="Songs" HorizontalAlignment="Right" Margin="0,6,54,0" Name="SongsRadioButton" VerticalAlignment="Top" Checked="SongsRadioButton_Checked" />
                    <TextBlock Text="Search:" HorizontalAlignment="Left" Name="label1" VerticalAlignment="Top" Margin="6,6,0,0" FontWeight="Bold" />
                    <TextBlock Text="Select what to include:" HorizontalAlignment="Left" Margin="6,54,0,0" Name="label2" VerticalAlignment="Top" />
                    <TextBox Height="23" Margin="6,25,6,0" Name="QueryTextBox" VerticalAlignment="Top" TextChanged="QueryTextBox_TextChanged" />
                    <my:CheckListBox Margin="6,73,6,6" x:Name="CategoriesListBox" SelectionChanged="CategoriesListBox_SelectionChanged" CheckedChanged="CategoriesListBox_CheckedChanged">
                        <ListBox.ContextMenu>
                            <ContextMenu>
                                <MenuItem Header="_Manage Categories..." Click="ConfigureCategoriesMenuItem_Click" />
                            </ContextMenu>
                        </ListBox.ContextMenu>
                    </my:CheckListBox>
                </Grid>
            </Border>
            <GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" Background="Gray" ResizeDirection="Rows" Height="4" Margin="0,4,0,4" />
            <ListBox Margin="0,29,0,30" Name="SongsListBox" MouseDoubleClick="SongsListBox_MouseDoubleClick" SelectionMode="Extended" SelectionChanged="SongsListBox_SelectionChanged" Grid.Row="2">
                <ListBox.ContextMenu>
                    <ContextMenu>
                        <MenuItem Name="NewSongMenuItem" Header="_New Song..." Click="AddSongButton_Click" />
                        <MenuItem Name="EditSongMenuItem" Header="_Edit Song..." Click="EditSongMenuItem_Click" />
                        <MenuItem Name="DeleteSongMenuItem" Header="_Delete Song" Click="DeleteSongButton_Click" />
                        <Separator />
                        <MenuItem Name="AddSelectedSongToPlayListMenuItem" Header="_Add to Play List" Click="AddSongToPlayListButton_Click" />
                        <MenuItem InputGestureText="Ctrl + P" Command="{StaticResource ProjectSongNowCommand}" Name="ProjectSongNowMenuItem" Header="_Project Song Now" />
                    </ContextMenu>
                </ListBox.ContextMenu>
            </ListBox>
            <TextBlock Grid.Row="2" HorizontalAlignment="Left" Margin="0,4,0,0" Text="Songs Found:" VerticalAlignment="Top" />
            <Button Grid.Row="2" Content="_Add New Song..." Height="23" HorizontalAlignment="Right" Name="AddSongButton" VerticalAlignment="Top" Width="103" Click="AddSongButton_Click" />
            <Button Grid.Row="2" Content="_Delete Song" Height="23" HorizontalAlignment="Left" Name="DeleteSongButton" VerticalAlignment="Bottom" Width="75" Click="DeleteSongButton_Click" />
            <Button Grid.Row="2" Content="Add to _Playlist »" Height="23" HorizontalAlignment="Right" Name="AddSongToPlayListButton" VerticalAlignment="Bottom" Width="103" Click="AddSongToPlayListButton_Click" />
        </Grid>
    </Grid>
</Window>
